import { Edit, MoreFilled, CircleCheck, Finished, FolderOpened, Calendar } from "@element-plus/icons-vue";

export const ValueType = {
  string: "String",
  object: "Object",
  array: "Array",
  number: "Number",
  date: "Date",
  user: "User",
  dept: "Dept",
  dateRange: "DateRange"
};

const fileTypeOption = [
  {
    value: "image/*",
    label: "image"
  },
  {
    value: "video/*",
    label: "video"
  },
  {
    value: ".doc,.docx",
    label: "doc"
  },
  {
    value: ".xlsx,.xls",
    label: "excel"
  },
  {
    value: ".pptx,.ppt",
    label: "ppt"
  },
  {
    value: ".pdf",
    label: "PDF"
  }
];

export const baseComponents = [
  {
    title: "单行文本",
    name: "TextInput",
    icon: Edit,
    value: "",
    valueType: ValueType.string,
    props: {
      required: false,
      validateFailMessage: "",
      disabled: false,
      clearable: true,
      showWordLimit: false,
      showDescription: false,
      description: "",
      validateTrigger: "",
      placeholder: "",
      defaultValue: "",
      minLength: "",
      maxLength: ""
    },
    optionsConfig: {
      // 图文案例
      imageTextList: [
        {
          id: "whole",
          title: "整体图文案例"
        }
      ],
      globalSimple: {
        pic: [],
        video: [],
        file: [],
        desc: ""
      },
      // 优劣势对比
      compareList: [
        {
          id: "whole",
          title: "整体优劣势对比"
        }
      ],
      globalCompare: []
    }
  },
  {
    title: "多行文本",
    name: "TextareaInput",
    icon: MoreFilled,
    value: "",
    valueType: ValueType.string,
    props: {
      required: false,
      disabled: false,
      showWordLimit: false,
      showDescription: false,
      description: "",
      validateFailMessage: "",
      validateTrigger: "",
      placeholder: "",
      minLength: "",
      maxLength: ""
    },
    optionsConfig: {
      // 图文案例
      imageTextList: [
        {
          id: "whole",
          title: "整体图文案例"
        }
      ],
      globalSimple: {
        pic: [],
        video: [],
        file: [],
        desc: ""
      },
      // 优劣势对比
      compareList: [
        {
          id: "whole",
          title: "整体优劣势对比"
        }
      ],
      globalCompare: [
        // {
        //   vdoing: "",
        //   desc: ""
        // }
      ]
    }
  },
  {
    title: "单选框",
    name: "SelectInput",
    icon: CircleCheck,
    value: "",
    valueType: ValueType.string,
    props: {
      required: false,
      expanding: false,
      showDescription: false,
      description: "",
      validateFailMessage: "",
      validateTrigger: "change",
      options: ["选项1", "选项2"],
      defaultValue: "",
      clearable: true
    },
    optionsConfig: {
      imageTextList: [
        {
          id: "whole",
          title: "整体图文案例"
        }
      ],
      globalSimple: {
        pic: [],
        video: [],
        file: [],
        desc: ""
      },
      optionSimple: [
        // {
        //   option: "",
        //   pic: [],
        //   video: [],
        //   file: [],
        //   desc: ""
        // }
      ],
      compareList: [
        {
          id: "whole",
          title: "整体优劣势对比"
        }
      ],
      globalCompare: [],
      optionCompare: [
        // {
        //   vdoing: "xx",
        //   主城十区内: "dxxxx",
        //   主城十区外: "dxxxx"
        // },
        // {
        //   vdoing: "xx",
        //   主城十区内: "dxxxx",
        //   主城十区外: "dxxxx"
        // }
      ]
    }
  },
  {
    title: "多选框",
    name: "MultipleSelect",
    icon: Finished,
    value: [],
    valueType: ValueType.array,
    props: {
      required: false,
      expanding: false,
      showDescription: false,
      clearable: true,
      description: "",
      validateFailMessage: "",
      validateTrigger: "change",
      options: ["选项1", "选项2"],
      defaultValue: []
    },
    optionsConfig: {
      imageTextList: [
        {
          id: "whole",
          title: "整体图文案例"
        }
      ],
      globalSimple: {
        pic: [],
        video: [],
        file: [],
        desc: ""
      },
      optionSimple: [
        // {
        //   option: "",
        //   pic: [],
        //   video: [],
        //   file: [],
        //   desc: ""
        // }
      ],
      compareList: [
        {
          id: "whole",
          title: "整体优劣势对比"
        }
      ],
      globalCompare: [],
      optionCompare: [
        // {
        //   vdoing: "xx",
        //   主城十区内: "dxxxx",
        //   主城十区外: "dxxxx"
        // },
        // {
        //   vdoing: "xx",
        //   主城十区内: "dxxxx",
        //   主城十区外: "dxxxx"
        // }
      ]
    }
  },
  {
    title: "日期时间",
    name: "DateTime",
    icon: Calendar,
    value: "",
    valueType: ValueType.date,
    props: {
      required: false,
      showDescription: false,
      clearable: true,
      description: "",
      validateFailMessage: "",
      validateTrigger: "change",
      format: "YYYY-MM-DD HH:mm",
      defaultValue: ""
    },
    optionsConfig: {
      imageTextList: [
        {
          id: "whole",
          title: "整体图文案例"
        }
      ],
      globalSimple: {
        pic: [],
        video: [],
        file: [],
        desc: ""
      },
      compareList: [
        {
          id: "whole",
          title: "整体优劣势对比"
        }
      ],
      globalCompare: []
    }
  },
  {
    title: "附件",
    name: "FileUpload",
    icon: FolderOpened,
    value: [],
    valueType: ValueType.array,
    props: {
      required: false,
      onlyRead: false,
      showDescription: false,
      drag: false,
      showFileList: true,
      defaultValue: [],
      dateFailMessage: "",
      description: "",
      fileReadRole: "public-read",
      maxSize: 10,
      maxNumber: 20,
      fileTypeOption,
      fileTypes: [],
      isCapture: false
    },
    optionsConfig: {
      imageTextList: [
        {
          id: "whole",
          title: "整体图文案例"
        }
      ],
      globalSimple: {
        pic: [],
        video: [],
        file: [],
        desc: ""
      },
      compareList: [
        {
          id: "whole",
          title: "整体优劣势对比"
        }
      ],
      globalCompare: []
    }
  }
];

export default {
  baseComponents
};
